﻿using System;
using System.Runtime.InteropServices;

namespace SilverlightViewport.Common.Interop
{
    [ComImport, Guid("922EADA0-3424-11CF-B670-00AA004CD6D8"), 
    InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    public interface IOleInPlaceSiteWindowless : IOleInPlaceSiteEx
    {
        [PreserveSig]
        new int GetWindow(out IntPtr phwnd);
        [PreserveSig]
        new int ContextSensitiveHelp([In] int fEnterMode);
        [PreserveSig]
        new int CanInPlaceActivate();
        [PreserveSig]
        new int OnInPlaceActivate();
        [PreserveSig]
        new int OnUIActivate();
        [PreserveSig]
        new int GetWindowContext([MarshalAs(UnmanagedType.Interface)] out IOleInPlaceFrame ppFrame,
                                 [MarshalAs(UnmanagedType.Interface)] out IOleInPlaceUIWindow ppDoc,
                                 [Out, MarshalAs(UnmanagedType.LPArray)] RECT[] lprcPosRect,
                                 [Out, MarshalAs(UnmanagedType.LPArray)] RECT[] lprcClipRect,
                                 [In, Out, MarshalAs(UnmanagedType.LPArray)] OLEINPLACEFRAMEINFO[] lpFrameInfo);
        [PreserveSig]
        new int Scroll([In] SIZE scrollExtant);
        [PreserveSig]
        new int OnUIDeactivate([In] int fUndoable);
        [PreserveSig]
        new int OnInPlaceDeactivate();
        [PreserveSig]
        new int DiscardUndoState();
        [PreserveSig]
        new int DeactivateAndUndo();
        [PreserveSig]
        new int OnPosRectChange([In, MarshalAs(UnmanagedType.LPArray)] RECT[] lprcPosRect);
        [PreserveSig]
        new int OnInPlaceActivateEx(out int pfNoRedraw, [In] uint dwFlags);
        [PreserveSig]
        new int OnInPlaceDeactivateEx([In] int fNoRedraw);
        [PreserveSig]
        new int RequestUIActivate();
        [PreserveSig]
        int CanWindowlessActivate();
        [PreserveSig]
        int GetCapture();
        [PreserveSig]
        int SetCapture([In] int fCapture);
        [PreserveSig]
        int GetFocus();
        [PreserveSig]
        int SetFocus([In] int fFocus);
        [PreserveSig]
        int GetDC([In, MarshalAs(UnmanagedType.LPArray)] RECT[] pRect, [In] uint grfFlags, out IntPtr phDC);
        [PreserveSig]
        int ReleaseDC([In] IntPtr hDC);
        [PreserveSig]
        int InvalidateRect([In, MarshalAs(UnmanagedType.LPArray)] RECT[] pRect, [In] int fErase);
        [PreserveSig]
        int InvalidateRgn([In] IntPtr hRGN, [In] int fErase);
        [PreserveSig]
        int ScrollRect([In] int dx, [In] int dy, [In, MarshalAs(UnmanagedType.LPArray)] RECT[] pRectScroll, [In, MarshalAs(UnmanagedType.LPArray)] RECT[] pRectClip);
        [PreserveSig]
        int AdjustRect([In, Out, MarshalAs(UnmanagedType.LPArray)] RECT[] prc);
        [PreserveSig]
        int OnDefWindowMessage([In] uint MSG, [In] IntPtr wParam, [In] IntPtr lParam, out int plResult);
    }
}
